<template>
  <div class="info">
    <h3>删除仓库</h3>

      <el-divider style="margin-bottom: 10%;"/>
      <div class="box-card2">
        <div class="message">
          <strong> 此操作无法恢复！请慎重操作！ </strong>
          <br />
          删除仓库将会连同其相关的所有数据（包括 Issues、Pull
          Requests、Wiki、Pages等在内）一起删除，同时取消仓库的协作者关联。
        </div>
      </div>


  <el-popconfirm
    confirm-button-text="确认"
    cancel-button-text="cancel"
    :icon="InfoFilled"
    icon-color="#626AEF"
    @confirm="del"
    title="确认删除该仓库?"
  >
    <template #reference>
      <el-button type="danger" style="margin-top: 2%;left: 25%;position: relative;">删除仓库</el-button>
    </template>
  </el-popconfirm>
      <!-- <el-button type="danger" @click="del" style="margin-top: 2%;left: 25%;position: relative;">删除仓库</el-button> -->
  </div>
</template>


<script>
import { ElMessage } from "element-plus";
import request from "@/utils/request";
export default {
  data() {
    return {};
  },

  methods: {
    del() {
      request
        .post(
          `/house/deletehouse?ownername=${this.$route.params.username}&housename=${this.$route.params.housename}`
        )
        .then((res) => {
          if (res.code == 200) {
            ElMessage("已成功删除仓库");
            this.$router.push("/userhomePage/"+this.$route.params.username);
          } else {
            ElMessage("失败");
          }
        });
    },
  },
};
</script>


<style>
.info {
  display: inline-block;
  position: absolute;
  margin-top: 3%;
  margin-left: 5%;
}
.box-card2 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Liberation Sans",
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Wenquanyi Micro Hei",
    "WenQuanYi Zen Hei", "ST Heiti", SimHei, SimSun, "WenQuanYi Zen Hei Sharp",
    sans-serif;
  line-height: 1.4;
  color: #40485b;
  -webkit-font-smoothing: antialiased;
  text-align: left;
  font-size: 1rem;
  width: 60%;
  clear: both;
  margin: 0em 0em 1.2em;
}
.message {
  -webkit-text-size-adjust: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Liberation Sans",
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Wenquanyi Micro Hei",
    "WenQuanYi Zen Hei", "ST Heiti", SimHei, SimSun, "WenQuanYi Zen Hei Sharp",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-align: left;
  box-sizing: inherit;
  position: relative;
  min-height: 1em;
  margin: 1em 0em;
  padding: 1em 1.5em;
  line-height: 1.4285em;
  transition: opacity 0.1s ease, color 0.1s ease, background 0.1s ease,
    box-shadow 0.1s ease, -webkit-box-shadow 0.1s ease;
  font-size: 1em;
  border-radius: 4px;
  border: 1px solid #e3e9ed;
  background: #fff;
  margin-bottom: 0em;
  background-color: #ffe8e6;
  color: #db2828;
  box-shadow: 0px 0px 0px 1px #db2828 inset, 0px 0px 0px 0px rgba(0, 0, 0, 0);
  margin-top: 0px;
}
#button:hover {
  cursor: default;
}
</style>